import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
// import.meta.globEager('./**/*.js');
const modules = import.meta.globEager('./*.js');

const mockModules = [];
Object.keys(modules).forEach((key) => {
  if (key.includes('/_')) {
    return;
  }
  mockModules.push(...modules[key].default);
});

export function setupProdMockServer() {
  createProdMockServer([...mockModules]);
}